import axios from 'axios';
export default {

 getToken(){
     axios.get()
    return localStorage.getItem('token');

},
 setToken(token){
    return localStorage.setItem('token',token);
},
 isLogind(){
     let flag=true;
    if(window.sessionStorage.getItem('token')){
        axios({
            url: 'http://127.0.0.1:8070/oauth/check_token',
            method: 'get',
            headers: {
              'x-helios-client': 'web',
              'Content-Type': 'application/json;charset=UTF-8',
              Accept: 'application/json',
            },
            params: {token: window.sessionStorage.getItem("token")},
          })
            .then(res => {
                console.log("okokoko")
            
            })
            .catch(e => {
                flag=false;
                console.log("errrrr")
               
              });
            ;
    }else{
        flag=false;
        console.log("errrrr")
    
    }
    return flag;
},
clearToken(){
    localStorage.removeItem('token');
}
}